//
//  WXPMineHeaderView.m
//  MexicoLoan
//
//  Created by wxp on 2025/2/25.
//

#import "WXPMineHeaderView.h"

@implementation WXPMineHeaderView

#pragma mark - lazy
- (UIView *)viewContent
{
    if (_viewContent == nil) {
        _viewContent = [UIView  new];
        _viewContent.backgroundColor = [UIColor clearColor];
        _viewContent.widthHeight = XY(SCREEN_WIDTH, 0);
        _viewContent.userInteractionEnabled = true;
    }
    return  _viewContent;
}
- (UIView *)navView
{
    if (_navView == nil) {
        _navView = [UIView  new];
        _navView.widthHeight = XY(SCREEN_HEIGHT, [GlobalMethod getNavgationBarHeight]-[GlobalMethod getStatusBarHeight]);
        self.btnNav.rightCenterY = XY(SCREEN_WIDTH-LEFT_MARDIN, _navView.height/2);
        [_navView addSubview:self.btnNav];
    }
    return  _navView;
}
- (WXPServiceBtn *)btnNav{
    if (!_btnNav) {
        _btnNav = [WXPServiceBtn new];
    }
    return _btnNav;
}
- (WXPMineUserInfoView *)viewUserInfo{
    if (!_viewUserInfo) {
        _viewUserInfo = [WXPMineUserInfoView new];
    }
    return _viewUserInfo;
}
- (WXPMineMiCreditoView *)viewMiCredito
{
    if (_viewMiCredito == nil) {
        _viewMiCredito = [WXPMineMiCreditoView  new];
    }
    return  _viewMiCredito;
}
- (WXPMineSettingView *)viewSetting
{
    if (_viewSetting == nil) {
        _viewSetting = [WXPMineSettingView  new];
    }
    return  _viewSetting;
}
- (WXPMineFAQView *)viewFAQ
{
    if (_viewFAQ == nil) {
        _viewFAQ = [WXPMineFAQView  new];
    }
    return  _viewFAQ;
}
- (WXPBannerView *)bannerView
{
    if (_bannerView == nil) {
        _bannerView = [WXPBannerView  new];
    }
    return  _bannerView;
}

#pragma mark - 初始化
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self configUI];
    }
    return self;
}

- (void)configUI
{
    [self resetHeaderView];
}

- (void)resetHeaderView{
    self.viewContent = [UIView initWithViews:@[
        self.navView,
        self.viewUserInfo,
        self.viewMiCredito,
        self.viewSetting,
        self.viewFAQ,
        isAry(self.bannerView.bannerList) ? self.bannerView : [UIView new],
    ]];
    if(self.blockResetHeaderView){
        self.blockResetHeaderView();
    }
}

@end
